package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;














import com.junsi.bean.SaleTrack;
import com.junsi.mapper.SaleTrackMapper;
import com.junsi.service.SaleTrackService;
import com.junsi.util.PageUtil;

/**   
  * @文件名: SaleServiceImpl.java 
  * @包名: com.junsi.service.impl 
  * @类名: SaleServiceImpl   
  * @时间: 2017年6月28日 上午9:21:00 2017
  * @作者: 
  * @类功能描述:TODO 请简要描述你的类   
  */
@Service
@Transactional(rollbackFor = Exception.class)
public class SaleTrackServiceImpl implements SaleTrackService {
	
	@Autowired
	private SaleTrackMapper saleTrackMapper;

	@Override
	public boolean save(SaleTrack saleTrack) {
		int result = saleTrackMapper.save(saleTrack);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public boolean deleteById(Integer id) {
		int result = saleTrackMapper.delete(id);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public boolean update(SaleTrack saleTrack){
		int result = saleTrackMapper.update(saleTrack);
		if(result == 1){
			return true;
		}else {
			return false;
		}
	}

	@Override
	public List<SaleTrack> findByAll() {
		return saleTrackMapper.findByAll();
	}

	@Override
	public List<SaleTrack> findBysaleId(Integer id,Integer endIndex,Integer beginIndex) {
		return saleTrackMapper.findSaleId(id,endIndex,beginIndex);
	}

	public List<SaleTrack> pageFind(PageUtil pageUtil) {
		// TODO Auto-generated method stub
		return saleTrackMapper.pageFind(pageUtil.getBeginIndex(), pageUtil.getEndIndex());
	}

	public int findCount() {
		// TODO Auto-generated method stub
		return saleTrackMapper.findCount();
	}

	public SaleTrack findById(Integer id) {
		// TODO Auto-generated method stub
		return saleTrackMapper.findById(id);
	}

	public List<SaleTrack> findclientId(Integer id, Integer endIndex,
			Integer startIndex) {
		// TODO Auto-generated method stub
		return saleTrackMapper.findclientId(id, endIndex, startIndex);
	}


}
